package com.aihwcm.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.apache.struts2.json.annotations.JSON;

/**
 * Aihchannels entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "aihchannels", catalog = "aihwcmdb")
public class Aihchannels implements java.io.Serializable {

	// Fields

	private Integer channelid;
	private String channelname;
	private String channelshowname;
	private String channelurl;
	private String channelabsurl;
	private Integer parentid;
	private Integer summarytemplateid;
	private Integer detailtemplateid;
	private Set<Aihdocuments> aihdocumentses = new HashSet<Aihdocuments>(0);

	// Constructors

	/** default constructor */
	public Aihchannels() {
	}

	/** minimal constructor */
	public Aihchannels(String channelname, String channelshowname) {
		this.channelname = channelname;
		this.channelshowname = channelshowname;
	}

	/** full constructor */
	public Aihchannels(String channelname, String channelshowname,
			String channelurl, String channelabsurl, Integer parentid,
			Integer summarytemplateid, Integer detailtemplateid,
			Set<Aihdocuments> aihdocumentses) {
		this.channelname = channelname;
		this.channelshowname = channelshowname;
		this.channelurl = channelurl;
		this.channelabsurl = channelabsurl;
		this.parentid = parentid;
		this.summarytemplateid = summarytemplateid;
		this.detailtemplateid = detailtemplateid;
		this.aihdocumentses = aihdocumentses;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "channelid", unique = true, nullable = false)
	public Integer getChannelid() {
		return this.channelid;
	}

	public void setChannelid(Integer channelid) {
		this.channelid = channelid;
	}

	@Column(name = "channelname", nullable = false, length = 100)
	public String getChannelname() {
		return this.channelname;
	}

	public void setChannelname(String channelname) {
		this.channelname = channelname;
	}

	@Column(name = "channelshowname", nullable = false, length = 100)
	public String getChannelshowname() {
		return this.channelshowname;
	}

	public void setChannelshowname(String channelshowname) {
		this.channelshowname = channelshowname;
	}

	@Column(name = "channelurl", length = 100)
	public String getChannelurl() {
		return this.channelurl;
	}

	public void setChannelurl(String channelurl) {
		this.channelurl = channelurl;
	}

	@Column(name = "channelabsurl", length = 100)
	public String getChannelabsurl() {
		return this.channelabsurl;
	}

	public void setChannelabsurl(String channelabsurl) {
		this.channelabsurl = channelabsurl;
	}

	@Column(name = "parentid")
	public Integer getParentid() {
		return this.parentid;
	}

	public void setParentid(Integer parentid) {
		this.parentid = parentid;
	}

	@Column(name = "summarytemplateid")
	public Integer getSummarytemplateid() {
		return this.summarytemplateid;
	}

	public void setSummarytemplateid(Integer summarytemplateid) {
		this.summarytemplateid = summarytemplateid;
	}

	@Column(name = "detailtemplateid")
	public Integer getDetailtemplateid() {
		return this.detailtemplateid;
	}

	public void setDetailtemplateid(Integer detailtemplateid) {
		this.detailtemplateid = detailtemplateid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "aihchannels")
	@JSON(serialize = false)
	public Set<Aihdocuments> getAihdocumentses() {
		return this.aihdocumentses;
	}

	public void setAihdocumentses(Set<Aihdocuments> aihdocumentses) {
		this.aihdocumentses = aihdocumentses;
	}

}